<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>forin</title>
</head>
<body>
  <script>
      var obj1 = {
        name : "宝强",
        age : 18,
        show:function () {
          console.log(this.name + "--" + this.age)
        }
      }
      for (let obj1Key in obj1) {
        console.log(obj1Key + "---" + obj1[obj1Key])
      }
      console.log("---------------")
      for (let obj1Key in obj1) {
        if(typeof obj1[obj1Key] == "function"){
          console.log(obj1[obj1Key]);
        }
      }

  </script>
</body>
</html>